import time
t_start = time.time()
file = open('m1_sorted.txt')
cheker_file = 0
sp_file = file.readlines()
t_start = time.time()
while cheker_file != len(sp_file):
    cheker_file = 0
    for i in range(len(sp_file) - 1):
        if sp[i] < sp[i + 1]:
            cheker_file += 1
        else:
            sp[i], sp[i + 1] = sp[i + 1], sp[i]
t_end = time.time()
print((t_end - t_start * 1000))
file2 = open('m2_reverse.txt')
cheker_file2 = 0
sp_2 = file2.readlines()
t_start2 = time.time()
while cheker_file != len(sp_file):
    cheker_file2 = 0
    for j in range(len(sp_2) - 1):
        if sp[j] < sp[j + 1]:
            cheker_file += 1
        else:
            sp[j], sp[j + 1] = sp[j + 1], sp[j]
t_end2 = time.time()
print((t_end2 - t_start2) * 1000)
file_3 = open('m3_shuffle.txt')
cheker_file3 = 0
sp_3 = file_3.read
t_start3 = time.time()
while cheker_file3 != len(sp_3):
    cheker_file3 = 0
    for h in range(len(sp_3) - 1):
        if sp[h] < sp[h + 1]:
            cheker_file3 += 1
        else:
            sp[h], sp[h + 1] = sp[h + 1], sp[h]
t_end3 = time.time()
print((t_end3 - t_start3) * 1000)
